/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.miracleteam.miracle.utils;

import com.miracleteam.miracle.entities.Danhmucsanpham;
import com.miracleteam.miracle.services.DanhMucSanPhamService;
import com.miracleteam.miracle.services.servicesImpl.DanhMucSanPhamServiceImpl;
import org.apache.tapestry5.ValueEncoder;

/**
 *
 * @author DangKhoa
 */
public class DanhMucSanPhamEncoder implements ValueEncoder<Danhmucsanpham> {
 

    public String toClient(Danhmucsanpham v) {
        return v.getMaDanhMuc();
    }

    public Danhmucsanpham toValue(String string) {
         DanhMucSanPhamService dmServ=new DanhMucSanPhamServiceImpl();
        return dmServ.LayDMSanPham(string);
    }
}
